[php] Question about jsmin-php code

I'm see some code from jsmin-php like follow:

<?php
error_reporting(E_STRICT);

fwrite(STDERR, memory_get_peak_usage(true)."\n");

require './jsmin.php';
echo JSMin::minify(file_get_contents('ext-all-debug.js'));

fwrite(STDERR, memory_get_peak_usage(true)."\n");
?>

I have some question about code
1.what is E_STRICT error level mean?I'm found an explain at
http://www.php.net/manual/en/errorfunc.constants.php
but i don't understand which situation need this level?
2.document for STDERR is at http://php.net/manual/en/wrappers.php.php
but why it write some output to STDERR ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hack988 hack988 [ Di, 29 Dezember 2009 12:07 ] [ ID #2027359 ]

Re: [php] Question about jsmin-php code

On Tue, Dec 29, 2009 at 12:07, hack988 hack988 <hack988 [at] dev.htwap.com> wrote:
> I have some question about code
> 1.what is E_STRICT error level mean?I'm found an explain at
> http://www.php.net/manual/en/errorfunc.constants.php
> but i don't understand which situation need this level?

E_STRICT is an error level indicating that you are doing something
that will work, but is for whatever reason discouraged. An example
would be using "var $foo;" for class properties instead of using one
of the visibility keywords public/protected/private.

It's basically a way of telling you that you are doing something that
is considered bad practice.

> 2.document for STDERR is at http://php.net/manual/en/wrappers.php.php
> but why it write some output to STDERR ?

The reason why one would want to write to STDERR (as opposed to
STDOUT) is if you are writing error messages. By standard on the
console, STDERR and STDOUT go the same place, but it's possible
redirecting both of these streams. If you redirect some output (STDOUT
specifically) to a file, you might still be interested in getting the
error messages on the screen.

See http://en.wikipedia.org/wiki/Standard_streams for more information
about that. Why your specific script would write to STDERR, I don't
know.

--
Daniel Egeberg

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Daniel Egeberg [ Di, 29 Dezember 2009 12:24 ] [ ID #2027360 ]
PHP » gmane.comp.php.general » [php] Question about jsmin-php code

Vorheriges Thema: MySQL Increment/Decrement
Nächstes Thema: Fatal error: Call to undefined function: mysqli_connect() in